<!-- 教练 – 我的		mine -->
<template>
	<view class="">
		<view class="mine-lan">

		</view>
		<view class="mine-nicheng">
			<view class="">
				<view class="f d c bold fs36" style="position:absolute;top:-90rpx;left:280rpx;" v-if="token">
					<image style="width: 196rpx;height: 196rpx;border-radius: 200rpx;" :src="img" mode=""></image>
					<text class="mt10">{{name}}</text>
				</view>
				<view class="f d c bold fs36" style="position:absolute;top:-90rpx;left:280rpx;" v-else @click="gologin">
					<image style="width: 196rpx;height: 196rpx;border-radius: 200rpx;" src="../../static/logo.jpg" mode=""></image>
					<text class="mt10">未登录</text>
				</view>
			</view>
			<view class="" style="margin-top:250rpx;">
				<view class="w90" @click="toMjiben()">
					<view class="f b c">
						<view class="vw25 f b c">
							<view>
								<image style="width: 25rpx;height: 25rpx;margin-top:12rpx;"
									src="../../static/img/079.png" mode=""></image>
							</view>
							<view>
								<text>基本信息</text>
							</view>
						</view>
						<view>
							<image style="width: 25rpx;height: 25rpx;" src="../../static/img/028.png" mode=""></image>
						</view>
					</view>
				</view>
				<view class="w90 p_t_20" @click="toMtuandui()">
					<view class="f b c">
						<view class="vw25 f b c">
							<view>
								<image style="width: 25rpx;height: 25rpx;margin-top:12rpx;"
									src="../../static/img/080.png" mode=""></image>
							</view>
							<view>
								<text>所在团队</text>
							</view>
						</view>
						<view>
							<image style="width: 25rpx;height: 25rpx;" src="../../static/img/028.png" mode=""></image>
						</view>
					</view>
				</view>
				<view class="w90 p_t_10" @click="gorizhi"  v-if="userInfo.type != 4">
					<view class="f b c">
						<view class="vw25 f b c">
							<view>
								<image style="width: 25rpx;height: 25rpx;margin-top:12rpx;"
									src="../../static/img/119.png" mode=""></image>
							</view>
							<view>
								<text>巡查日志</text>
							</view>
						</view>
						<view>
							<image style="width: 25rpx;height: 25rpx;" src="../../static/img/028.png" mode="">
							</image>
						</view>
					</view>
				</view>
				
				<view class="w90 p_t_20" @click="toMxingji()"  v-if="userInfo.type == 3">
					<view class="f b c">
						<view class="vw25 f b c">
							<view>
								<image style="width: 25rpx;height: 25rpx;margin-top:12rpx;"
									src="../../static/img/081.png" mode=""></image>
							</view>
							<view>
								<text>星级标准</text>
							</view>
						</view>
						<view>
							<image style="width: 25rpx;height: 25rpx;" src="../../static/img/028.png" mode=""></image>
						</view>
					</view>
				</view>
				<view class="w90 p_t_20" @click="toMjineng(userInfo.video)"  v-if="userInfo.type == 3">
					<view class="f b c">
						<view class="vw25 f b c">
							<view>
								<image style="width: 25rpx;height: 25rpx;margin-top:12rpx;"
									src="../../static/img/082.png" mode=""></image>
							</view>
							<view>
								<text>技能视频</text>
							</view>
						</view>
						<view>
							<image style="width: 25rpx;height: 25rpx;" src="../../static/img/028.png" mode=""></image>
						</view>
					</view>
				</view>
				<view class="w90 p_t_20" @click="toMzhengshu(userInfo.certificate)"  v-if="userInfo.type == 3">
					<view class="f b c">
						<view class="vw25 f b c">
							<view>
								<image style="width: 25rpx;height: 25rpx;margin-top:12rpx;"
									src="../../static/img/083.png" mode=""></image>
							</view>
							<view>
								<text>我的证书</text>
							</view>
						</view>
						<view>
							<image style="width: 25rpx;height: 25rpx;" src="../../static/img/028.png" mode=""></image>
						</view>
					</view>
				</view>
				<view class="w90 p_t_20" @click="toMkecheng()"  v-if="userInfo.type == 3">
					<view class="f b c">
						<view class="vw25 f b c">
							<view>
								<image style="width: 25rpx;height: 25rpx;margin-top:12rpx;"
									src="../../static/img/084.png" mode=""></image>
							</view>
							<view>
								<text>我的课程</text>
							</view>
						</view>
						<view>
							<image style="width: 25rpx;height: 25rpx;" src="../../static/img/028.png" mode=""></image>
						</view>
					</view>
				</view>
				<view class="w90 p_t_20" @click="toMjiaoan()">
					<view class="f b c">
						<view class="vw25 f b c">
							<view>
								<image style="width: 25rpx;height: 25rpx;margin-top:12rpx;"
									src="../../static/img/085.png" mode=""></image>
							</view>
							<view>
								<text>员工教案</text>
							</view>
						</view>
						<view>
							<image style="width: 25rpx;height: 25rpx;" src="../../static/img/028.png" mode=""></image>
						</view>
					</view>
				</view>
				<view class="w90 p_t_10" @click="gofankui"  v-if="userInfo.type != 3">
					<view class="f b c">
						<view class="vw25 f b c">
							<view>
								<image style="width: 25rpx;height: 25rpx;margin-top:12rpx;"
									src="../../static/img/114.png" mode=""></image>
							</view>
							<view>
								<text>反馈列表</text>
							</view>
						</view>
						<view class="dis-flex flex-align-center">
							<view v-if="fknum > 0" class="c-fff fs120 pl5 pr5 mr5" style="border-radius: 50%;background-color: red;">
								{{fknum}}
							</view>
							<view class="">
								<image style="width: 25rpx;height: 25rpx;" src="../../static/img/028.png" mode="">
								</image>
							</view>
							
						</view>
					</view>
				</view>
				<view class="w90 p_t_20" @click="toMhetong()">
					<view class="f b c">
						<view class="vw25 f b c">
							<view>
								<image style="width: 25rpx;height: 25rpx;margin-top:12rpx;"
									src="../../static/img/086.png" mode=""></image>
							</view>
							<view>
								<text>合同协议</text>
							</view>
						</view>
						<view>
							<image style="width: 25rpx;height: 25rpx;" src="../../static/img/028.png" mode=""></image>
						</view>
					</view>
				</view>
				<view class="w90 p_t_20" @click="out()">
					<view class="f b c">
						<view class="vw25 f b c">
							<view>
								<image style="width: 25rpx;height: 25rpx;margin-top:12rpx;"
									src="../../static/img/086.png" mode=""></image>
							</view>
							<view>
								<text>退出登录</text>
							</view>
						</view>
						<view>
							<image style="width: 25rpx;height: 25rpx;" src="../../static/img/028.png" mode=""></image>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
		export default {
			data() {
				return {
					token:'',
					name:'',
					img:'',
					userInfo:[],
					fknum:0
				}
			},
			onLoad() {
			
			},
			onShow() {
				this.token = uni.getStorageSync('token');
				this.userInfo = uni.getStorageSync('userInfo');
				if(this.token){
					this.init()
				}
			},
			methods: {
				init(){
					var that = this
					that.$http.post(that.$config.UrlPostadminapiuser, {}).then((res) => {
						if (res.status == 1) {
							that.userInfo = res.data
							that.img = res.data.img
							that.name = res.data.name
							that.fknum = res.data.fknum
							uni.setStorageSync('userInfo',res.data);
							
							
						}
					})
				},
				gologin(){
					if(this.token == ''){
						this.$api.openWindow("/pages/login/login")
					}
				},
				toMjiben(){
					if(this.token == ''){
						this.$api.openWindow("/pages/login/login")
						return
					}
					var data = encodeURIComponent(JSON.stringify(this.userInfo))
					uni.navigateTo({
						url:"basic/basic?data="+data
					})
					
				},
				toMtuandui(){
					if(this.token == ''){
						this.$api.openWindow("/pages/login/login")
						return
					}
					uni.navigateTo({
						url:"teams/teams"
					})
				},
				toMxingji(){
					if(this.token == ''){
						this.$api.openWindow("/pages/login/login")
						return
					}
					uni.navigateTo({
						url:"standard/standard"
					})
				},
				toMjineng(item){
					if(this.token == ''){
						this.$api.openWindow("/pages/login/login")
						return
					}
					uni.navigateTo({
						url:"Skills/Skills?videoUrl="+item
					})
				},
				toMzhengshu(item){
					if(this.token == ''){
						this.$api.openWindow("/pages/login/login")
						return
					}
					uni.navigateTo({
						url:"certificate/certificate?zhengshu="+item
					})
				},
				toMkecheng(){
					if(this.token == ''){
						this.$api.openWindow("/pages/login/login")
						return
					}
					uni.navigateTo({
						url:"kecheng/kecheng"
					})
				},
				toMjiaoan(){
					if(this.token == ''){
						this.$api.openWindow("/pages/login/login")
						return
					}
					uni.navigateTo({
						url:"lesson/lesson"
					})
				},
				toMhetong(){
					if(this.token == ''){
						this.$api.openWindow("/pages/login/login")
						return
					}
					uni.navigateTo({
						url:"contract/contract"
					})
				},
				gorizhi(){
					if(this.token == ''){
						this.$api.openWindow("/pages/login/login")
						return
					}
					uni.navigateTo({
						url:"xuncharizhi/xuncharizhi"
					})
				},
				gofankui(){
					if(this.token == ''){
						this.$api.openWindow("/pages/login/login")
						return
					}
					uni.navigateTo({
						url:"fankui/fankui"
					})
				},
				out(){
					var that = this
					that.$api.alertConfirm('确认都退出当前账号?',()=>{
						uni.removeStorageSync('token')
						that.token = '';
						uni.removeStorageSync('userInfo')
						that.$api.toast('退出成功')
					
					})
				}
			}
		}
</script>

<style scoped>
	.warps {
		/* height:200vh; */
		overflow: hidden;
		background-color: #FFFFFF;
	}

	.mine-lan {
		width: 750rpx;
		height:240rpx;
		background: #CDE9FF;
		position: relative;
		overflow: hidden;
	}

	.mine-nicheng {
		width: 750rpx;
		height: 1100rpx;
		opacity: 1;
		background: #ffffff;
		border-radius: 40rpx 40rpx 0rpx 0rpx;
		position: absolute;
		top: 200rpx;
	}
	.TBB{
		width:100vw;
		position:fixed;
		bottom:0rpx;
	}
</style>

